package response

import (
	"github.com/valyala/fasthttp"
	"net/http"
)

type ResponseInterface interface {
	HeaderAdd(key string, value string)
}

func NewHttpResponse(w http.ResponseWriter) ResponseInterface {
	return &HttpResponse{
		response: w,
	}
}

type HttpResponse struct {
	response http.ResponseWriter
}

func (r *HttpResponse) HeaderAdd(key string, value string) {
	r.response.Header().Add(key, value)
}

func NewFastHttpResponse(w *fasthttp.Response) ResponseInterface {
	return &FastHttpResponse{
		response: w,
	}
}

type FastHttpResponse struct {
	response *fasthttp.Response
}

func (r *FastHttpResponse) HeaderAdd(key string, value string) {
	r.response.Header.Set(key, value)
}
